package com.sheepone.util.console.table;

import com.sheepone.util.enums.Locate;

/**
 * Create by IntelliJ IDEA
 * table cell
 * @author chenlei
 * @dateTime 2018/12/11 9:52
 * @description Cell
 */
public class Cell {

    private Locate locate = Locate.LEFT;

    private Object value;

    public Cell(){

    }

    public Cell(Locate align, Object value){
        this.locate = align;
        this.value = value;
    }

    public Cell(Object value){
        this.value = value;
    }

    public void setLocate(Locate locate) {
        this.locate = locate;
    }

    public Locate getLocate() {
        return locate;
    }

    public Object getValue() {
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return String.format("{%s: %s,%s: %s}", "value", value, "align", locate.name());
    }
}